package org.xx.armory.web.tags;

import javax.servlet.jsp.JspException;

public final class HtmlImage extends BaseHtmlTagHandler {
    private static final long serialVersionUID = 1L;
    private static final String IMAGES_PATH = "images";
    private String src = "";

    public HtmlImage() {
    }

    public final String getSrc() {
        return this.src;
    }

    public final void setSrc(String value) {
        this.src = value == null ? "" : value.trim();
    }

    public int doStartTag() throws JspException {
        if (!this.getSrc().isEmpty()) {
            String src = TagUtils.evalRelThemeUrl(this.pageContext, "images", this.getSrc());
            this.setValue("src", src);
        }

        return super.doStartTag();
    }

    protected String getTagName() {
        return "img";
    }
}

